import {
    uploadRequest,
    getRequest,
    postRequest
} from '@/lib/request';

export const fileApi = {
    upload: (file, folder) => {
        return uploadRequest(file, folder);
    },
    // 收藏列表
    favoriteCourses: (data) => {
        return getRequest(
            `/my-favorite-courses?keyword=${data.keyword}`
        )
    },
    // 我的课程
    getMyCourses: (data) => {
        return getRequest(
            `/my-courses?keyword=${data.keyword}`
        )
    },
    // 我的题库
    getMyQuestion: (data) => {
        return getRequest(
            `/question-setting/my-question-banks`
        )
    },
    // 电子资料列表
    getCategoryId: (data) => {
        return getRequest(
            `/documents?category_id=${data.category_id}&keyword=${data.keyword}`
        )
    },
    // 电子资料详情
    getDocuments: (data) => {
        return getRequest(
            `/documents/${data}`
        )
    },
    // 通知列表
    getUserNotifications: (data) => {
        return getRequest(
            `/user-notifications`
        )
    },
    // 用户购买的专业VIP套餐信息
    getVipPackages: () => {
        return getRequest(
            `/vip-packages/user-packages`
        )
    },
    // 获取所有专业列表，显示用户购买状态和到期时间
    getAllMajors: (data) => {
        console.log(data,'data')
        return getRequest(
            `/vip-packages/all-majors?major_name=${data.major_name}`
        )
    },
    // 获取所有专业列表，显示用户购买状态和到期时间
    getCasings: (data) => {
        console.log(data,'data')
        return getRequest(
            `/question-category-order/casings`
        )
    },
};